package thread;

public class ThreadInfoDemo {
    public static void main(String[] args) {
        Thread main = Thread.currentThread();

        String name = main.getName();
        System.out.println("名   字:  "+name);

        long id = main.getId();
        System.out.println("唯一标识:  "+id);

        int priority = main.getPriority();
        System.out.println("优 先 级： "+priority);

        boolean alive = main.isAlive();
        boolean daemon = main.isDaemon();
        boolean interrupted = main.isInterrupted();

        System.out.println("是否存活："+alive);
        System.out.println("是否是守护线程："+daemon);
        System.out.println("是否被中断："+interrupted);

    }
}
